namespace QMVnSoft.Controls
{
    using QMVnSoft;
    using QMVnSoft.Controls.ChildGridControls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    [ToolboxBitmap(@"D:\TAMNV\AppSOFT\AppAPP\BMPs\App32.ico")]
    public class TextSearchLotNumber : TextControl
    {
        private bool ib_CheckAutoFill;
        private bool ib_CheckDeleteKey;
        private bool ib_CheckEscKey;
        private bool ib_CheckExactly;
        private bool ib_CheckFillDestination = true;
        private bool ib_CheckMovable = true;
        private bool ib_CheckUserKey;
        private bool ib_EachWord;
        private bool ib_EmptyIsValid = true;
        private bool ib_FilterType;
        private bool ib_FoundIsValid = true;
        private bool ib_MatchCase;
        private bool ib_Searched;
        private bool ib_TextChanged;
        private bool ib_UserNoChanged;
        private DateTime id_InvoiceDate;
        private object ii_InvoicePosted;
        private int ii_LocalWorkArea;
        private int ii_MaxRows = 10;
        private int ii_StartPos = 1;
        private string is_DestinationFields = "Han_Dung, H_Luong, Do_Am_PT, Do_Con_PT";
        private string is_DetailKey;
        private string is_FieldDisplay = "";
        private string is_FieldList = "";
        private string is_FieldName = "";
        private string is_FieldOrders = "";
        private string is_FilterFieldList = "";
        private string is_FirstFilter = "";
        private object is_InventoryCode;
        private object is_InventoryInputCode = DBNull.Value;
        private object is_LocalItemCode;
        private string is_MasterKey;
        private object is_RackNumber = DBNull.Value;
        private string is_SourceFields = "Han_Dung, H_Luong, Do_Am_PT, Do_Con_PT";
        private string is_TableName = "LOHANG";
        private GridControl oBrowser;
        private DataRow oDataRow;
        private DataTable oDataTable;
        private DataTable oLocalDetailTable;
        private TextBox oTextDisplay;
        private Timer oTimer;

        public TextSearchLotNumber()
        {
            base.CharacterCasing = CharacterCasing.Upper;
            this.Text = "";
            base.GotFocus += new EventHandler(this.TextSearch_GotFocus);
            base.TextChanged += new EventHandler(this.TextSearch_TextChanged);
            base.KeyDown += new KeyEventHandler(this.TextSearch_KeyDown);
            base.Validating += new CancelEventHandler(this.TextSearch_Validating);
            base.Leave += new EventHandler(this.TextSearch_Leave);
        }

        private void FillDestination()
        {
            if (((!this.EmptyIsValid && this.CheckExactly) && (!this.ib_CheckFillDestination && !this.Text.Equals(string.Empty))) && ((base.Parent is Panel) && (base.Parent.Parent is DataGridView)))
            {
                this.ib_CheckFillDestination = true;
                (base.Parent.Parent as DataGridView).CurrentCell.Value = this.Text;
                if (!this.SourceFields.Equals(string.Empty) || !this.DestinationFields.Equals(string.Empty))
                {
                    string str = this.SourceFields + ",";
                    string str2 = this.DestinationFields + ",";
                    string str3 = "";
                    string name = "";
                    DataRow row = ((base.Parent.Parent as DataGridView).CurrentRow.DataBoundItem as DataRowView).Row;
                    while (str.Contains(",") && str2.Contains(","))
                    {
                        str3 = str.Substring(0, str.IndexOf(","));
                        str = ((str.IndexOf(",") + 1) < str.Length) ? str.Substring(str.IndexOf(",") + 1, (str.Length - str.IndexOf(",")) - 1) : "";
                        name = str2.Substring(0, str2.IndexOf(","));
                        str2 = ((str2.IndexOf(",") + 1) < str2.Length) ? str2.Substring(str2.IndexOf(",") + 1, (str2.Length - str2.IndexOf(",")) - 1) : "";
                        str3 = str3.Trim();
                        name = name.Trim();
                        object fieldData = this.GetFieldData(str3);
                        if ((fieldData != null) && row.Table.Columns.Contains(name))
                        {
                            row[name] = fieldData;
                        }
                    }
                    row.EndEdit();
                }
            }
        }

        public object GetFieldData(string ps_FieldName)
        {
            if ((this.OneRowData != null) && this.OneRowData.Table.Columns.Contains(ps_FieldName))
            {
                return this.OneRowData[ps_FieldName];
            }
            return DBNull.Value;
        }

        private void KeyWait(object sender, EventArgs e)
        {
            if (this.ib_CheckUserKey)
            {
                this.ib_CheckUserKey = false;
                this.TimerKeyWait.Stop();
            }
            else
            {
                this.TimerKeyWait.Stop();
                this.Searched();
            }
        }

        private void Parameters_Get()
        {
            if (!this.TableName.Equals(string.Empty))
            {
                string str = "";
                string str2 = "";
                string str3 = "";
                string str4 = "";
                bool flag = false;
                bool flag2 = false;
                int num = 0;
                int num2 = 10;
                bool flag3 = false;
                AppDataAccess.Parameter_Search_Select(this.TableName, ref str, ref str2, ref str3, ref str4, ref flag, ref flag2, ref num, ref num2, ref flag3);
                this.FieldList = str;
                this.FieldName = str2;
                this.FieldOrders = str3;
                this.FilterFieldList = str4;
                this.FilterType = flag;
                this.MatchCase = flag2;
                this.StartPos = num;
                this.MaxRows = num2;
                this.EachWord = flag3;
                if (this.FilterFieldList.Contains(","))
                {
                    base.CharacterCasing = CharacterCasing.Normal;
                }
            }
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            this.ib_CheckEscKey = false;
            if (keyData == Keys.Escape)
            {
                this.ib_CheckEscKey = true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        private void Searched()
        {
            if (((!this.Text.Equals(string.Empty) && !this.FieldName.Equals(string.Empty)) && ((base.SelectionStart >= this.StartPos) || this.ib_CheckAutoFill)) && !this.ib_UserNoChanged)
            {
                this.ib_Searched = true;
                int selectionStart = base.SelectionStart;
                if (this.LocalWorkArea == 0)
                {
                    this.oDataTable = (base.FindForm() as FormEditor).AppInvoiceParameters.MakeLotQtyTable(this.MaxRows, this.InvoicePosted, this.MasterKey, this.DetailKey, this.InvoiceDate, this.InventoryCode, this.LocalItemCode, this.InventoryInputCode, this.Text.Trim(), this.LocalDetailTable);
                }
                else if (this.LocalWorkArea == 1)
                {
                    this.oDataTable = (base.FindForm() as FormEditor).AppInvoiceParameters.MakeOutLotQtyTable(this.MaxRows, this.InvoicePosted, this.MasterKey, this.DetailKey, this.InvoiceDate, this.InventoryCode, this.LocalItemCode, this.Text.Trim(), this.LocalDetailTable);
                }
                else
                {
                    this.oDataTable = (base.FindForm() as FormEditor).AppInvoiceParameters.MakeStockLotQtyTable(this.MaxRows, this.InvoicePosted, this.MasterKey, this.DetailKey, this.InvoiceDate, this.InventoryCode, this.RackNumber, this.LocalItemCode, this.InventoryInputCode, this.Text.Trim(), this.LocalDetailTable);
                }
                if ((this.oDataTable == null) || (this.oDataTable.Rows.Count == 0))
                {
                    this.GridBrowser.Visible = false;
                }
                else
                {
                    if ((!this.ib_CheckDeleteKey && !this.FilterFieldList.Contains(",")) && !this.MatchCase)
                    {
                        this.ib_UserNoChanged = true;
                        base.Value = this.oDataTable.Rows[0][this.FieldName];
                        base.SelectionStart = selectionStart;
                        this.SelectionLength = (this.Text.Length > selectionStart) ? (this.Text.Length - selectionStart) : 0;
                        this.ib_UserNoChanged = false;
                    }
                    this.GridBrowser.AutoGenerateColumns = false;
                    this.GridBrowser.Columns.Clear();
                    this.GridBrowser.DataSource = this.oDataTable;
                    this.GridBrowser.DataMember = this.oDataTable.TableName;
                    this.GridBrowser.BringToFront();
                    for (int i = 0; i < this.oDataTable.Columns.Count; i++)
                    {
                        if (this.oDataTable.Columns[i].DataType == typeof(decimal))
                        {
                            NumericColumn dataGridViewColumn = new NumericColumn();
                            dataGridViewColumn.DataPropertyName = this.oDataTable.Columns[i].ColumnName;
                            dataGridViewColumn.UserTextNumericFormat = AppInstance.TextNumericFormat.Quantity;
                            this.GridBrowser.Columns.Add(dataGridViewColumn);
                        }
                        else if (this.oDataTable.Columns[i].DataType == typeof(DateTime))
                        {
                            DataGridViewTextBoxColumn column2 = new DataGridViewTextBoxColumn();
                            column2.DataPropertyName = this.oDataTable.Columns[i].ColumnName;
                            this.GridBrowser.Columns.Add(column2);
                        }
                        else if (this.oDataTable.Columns[i].DataType == typeof(bool))
                        {
                            DataGridViewCheckBoxColumn column3 = new DataGridViewCheckBoxColumn();
                            column3.DataPropertyName = this.oDataTable.Columns[i].ColumnName;
                            this.GridBrowser.Columns.Add(column3);
                        }
                        else
                        {
                            DataGridViewTextBoxColumn column4 = new DataGridViewTextBoxColumn();
                            column4.DataPropertyName = this.oDataTable.Columns[i].ColumnName;
                            this.GridBrowser.Columns.Add(column4);
                        }
                    }
                    if (!this.GridBrowser.Visible)
                    {
                        this.GridBrowser.Visible = true;
                    }
                    this.GridBrowser.AutoSize = false;
                    this.GridBrowser.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                    this.GridBrowser.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
                    int num3 = 0;
                    int num4 = ((this.MaxRows == 0) ? 20 : this.MaxRows) * this.GridBrowser.RowTemplate.Height;
                    num4 = (num4 > (base.FindForm().ClientSize.Height - this.GridBrowser.Top)) ? (base.FindForm().ClientSize.Height - this.GridBrowser.Top) : num4;
                    num4 = (num4 < 60) ? 60 : num4;
                    this.GridBrowser.Height = num4;
                    foreach (DataGridViewColumn column5 in this.GridBrowser.Columns)
                    {
                        num3 += column5.Width;
                    }
                    this.GridBrowser.Width = num3 + this.GridBrowser.DataGridViewScrollWidth;
                    if (this.GridBrowser.Width > base.FindForm().ClientSize.Width)
                    {
                        this.GridBrowser.Width = base.FindForm().ClientSize.Width;
                        this.GridBrowser.Location = new Point(0, this.GridBrowser.Top);
                    }
                    else if ((base.FindForm().ClientSize.Width - base.Left) < this.GridBrowser.Width)
                    {
                        this.GridBrowser.Location = new Point(base.FindForm().ClientSize.Width - this.GridBrowser.Width, this.GridBrowser.Top);
                    }
                }
            }
        }

        private void TextSearch_GotFocus(object sender, EventArgs e)
        {
            this.ib_CheckFillDestination = true;
            this.ib_TextChanged = false;
            this.ib_UserNoChanged = false;
            Form form = base.FindForm();
            if (!form.Controls.Contains(this.GridBrowser))
            {
                this.GridBrowser.Visible = false;
                this.GridBrowser.ScrollBars = ScrollBars.Vertical;
                this.GridBrowser.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
                this.GridBrowser.RowHeadersVisible = false;
                this.GridBrowser.AllowUserToAddRows = false;
                this.GridBrowser.ReadOnly = true;
                form.Controls.Add(this.GridBrowser);
            }
            int y = 0;
            int x = 0;
            object parent = null;
            y = base.Location.Y + base.Height;
            x = base.Location.X;
            parent = base.Parent;
            while ((parent as Form) != form)
            {
                if (parent is UserControl)
                {
                    y += (parent as UserControl).Top;
                    x += (parent as UserControl).Left;
                    parent = (parent as UserControl).Parent;
                }
                else
                {
                    if (parent is Panel)
                    {
                        y += (parent as Panel).Top;
                        x += (parent as Panel).Left;
                        parent = (parent as Panel).Parent;
                        continue;
                    }
                    if (parent is SplitterPanel)
                    {
                        y += (parent as SplitterPanel).Top;
                        x += (parent as SplitterPanel).Left;
                        parent = (parent as SplitterPanel).Parent;
                        continue;
                    }
                    if (parent is SplitContainer)
                    {
                        y += (parent as SplitContainer).Top;
                        x += (parent as SplitContainer).Left;
                        parent = (parent as SplitContainer).Parent;
                        continue;
                    }
                    if (parent is DataGridView)
                    {
                        y = (y + (parent as DataGridView).Top) + 4;
                        x = (x + (parent as DataGridView).Left) - 3;
                        parent = (parent as DataGridView).Parent;
                        continue;
                    }
                    if (parent is TabContol)
                    {
                        y += (parent as TabContol).Top;
                        x += (parent as TabContol).Left;
                        parent = (parent as TabContol).Parent;
                        continue;
                    }
                    if (!(parent is GroupBox))
                    {
                        break;
                    }
                    y += (parent as GroupBox).Top;
                    x += (parent as GroupBox).Left;
                    parent = (parent as GroupBox).Parent;
                }
            }
            this.GridBrowser.Location = new Point(x, y);
            this.GridBrowser.ColumnHeadersVisible = false;
            this.Parameters_Get();
        }

        private void TextSearch_KeyDown(object sender, KeyEventArgs e)
        {
            CurrencyManager manager;
            if (this.GridBrowser.DataSource != null)
            {
                this.ib_CheckDeleteKey = false;
                this.ib_CheckUserKey = true;
                manager = base.FindForm().BindingContext[this.GridBrowser.DataSource, this.GridBrowser.DataMember] as CurrencyManager;
                switch (e.KeyCode)
                {
                    case Keys.Up:
                        manager.Position--;
                        goto Label_00A9;

                    case Keys.Down:
                        manager.Position++;
                        goto Label_00A9;

                    case Keys.Delete:
                        this.ib_CheckDeleteKey = true;
                        goto Label_00A9;

                    case Keys.Back:
                        this.ib_CheckDeleteKey = true;
                        goto Label_00A9;
                }
                this.ib_CheckUserKey = false;
            }
            return;
        Label_00A9:
            if (!this.ib_CheckDeleteKey)
            {
                this.Text = ((DataRowView) manager.Current).Row[this.FieldName].ToString();
                base.SelectionStart = this.Text.Trim().Length + 1;
                if (!this.CheckExactly)
                {
                    if (this.TextDisplay != null)
                    {
                        this.TextDisplay.Text = "";
                    }
                }
                else if (((this.TextDisplay != null) && !this.FieldDisplay.Equals(string.Empty)) && (this.OneRowData != null))
                {
                    this.TextDisplay.Text = this.OneRowData[this.FieldDisplay].ToString();
                }
                e.Handled = true;
            }
        }

        private void TextSearch_Leave(object sender, EventArgs e)
        {
            this.TimerKeyWait.Stop();
        }

        private void TextSearch_TextChanged(object sender, EventArgs e)
        {
            if ((!this.ib_UserNoChanged && !base.ReadOnly) && base.Enabled)
            {
                this.ib_CheckFillDestination = false;
                this.ib_TextChanged = true;
                this.ib_Searched = false;
                this.TimerKeyWait.Stop();
                this.TimerKeyWait.Start();
            }
        }

        private void TextSearch_Validating(object sender, CancelEventArgs e)
        {
            if (!base.ReadOnly && !this.ib_CheckEscKey)
            {
                if (this.TableName.Equals(string.Empty))
                {
                    e.Cancel = true;
                }
                else
                {
                    if (this.ib_TextChanged && !this.ib_Searched)
                    {
                        this.Searched();
                    }
                    this.TimerKeyWait.Stop();
                    this.ib_UserNoChanged = true;
                    if (this.GridBrowser.Visible)
                    {
                        if (!this.ib_CheckDeleteKey)
                        {
                            CurrencyManager manager = base.FindForm().BindingContext[this.GridBrowser.DataSource, this.GridBrowser.DataMember] as CurrencyManager;
                            this.Text = ((DataRowView) manager.Current).Row[this.FieldName].ToString();
                        }
                        this.GridBrowser.Visible = false;
                    }
                    if (!this.CheckExactly)
                    {
                        if (this.TextDisplay != null)
                        {
                            this.TextDisplay.Text = "";
                        }
                    }
                    else if ((this.TextDisplay != null) && !this.FieldDisplay.Equals(string.Empty))
                    {
                        this.TextDisplay.Text = this.OneRowData[this.FieldDisplay].ToString();
                    }
                    this.FillDestination();
                    if (!this.CheckMovable)
                    {
                        e.Cancel = true;
                    }
                }
            }
        }

        private bool CheckExactly
        {
            get
            {
                if (((this.OneRowData != null) && this.OneRowData.Table.Columns.Contains(this.FieldName)) && this.OneRowData[this.FieldName].ToString().Equals(this.Text))
                {
                    this.ib_CheckExactly = true;
                }
                else
                {
                    this.ib_CheckExactly = false;
                }
                return this.ib_CheckExactly;
            }
        }

        [Description("Indicates if it is movable cell."), Category("Searched properties"), DefaultValue(true), RefreshProperties(RefreshProperties.All)]
        public bool CheckMovable
        {
            get
            {
                return this.ib_CheckMovable;
            }
            set
            {
                this.ib_CheckMovable = value;
            }
        }

        [Browsable(false), Category("Searched properties"), DefaultValue(""), RefreshProperties(RefreshProperties.All), Description("The field names to set data.")]
        public string DestinationFields
        {
            get
            {
                return this.is_DestinationFields;
            }
            set
            {
                this.is_DestinationFields = value;
            }
        }

        public string DetailKey
        {
            get
            {
                return this.is_DetailKey;
            }
            set
            {
                this.is_DetailKey = value;
            }
        }

        [Description("Search each word or a sentence"), Category("Searched properties"), RefreshProperties(RefreshProperties.All)]
        private bool EachWord
        {
            get
            {
                return this.ib_EachWord;
            }
            set
            {
                this.ib_EachWord = value;
            }
        }

        [Category("Searched properties"), DefaultValue(false), RefreshProperties(RefreshProperties.All), Description("Indicates if the value empty valid.")]
        public bool EmptyIsValid
        {
            get
            {
                if (!this.ib_EmptyIsValid)
                {
                    return this.ib_EmptyIsValid;
                }
                if (this.FoundIsValid && !this.Text.Trim().Equals(string.Empty))
                {
                    return false;
                }
                return true;
            }
            set
            {
                this.ib_EmptyIsValid = value;
            }
        }

        [Category("Searched properties"), DefaultValue(""), RefreshProperties(RefreshProperties.All), Description("The field name to show description")]
        public string FieldDisplay
        {
            get
            {
                return this.is_FieldDisplay;
            }
            set
            {
                if (value == null)
                {
                    value = "";
                }
                this.is_FieldDisplay = value;
            }
        }

        [Category("Searched properties"), Description("Field list to display"), RefreshProperties(RefreshProperties.All)]
        private string FieldList
        {
            get
            {
                return this.is_FieldList;
            }
            set
            {
                this.is_FieldList = value;
            }
        }

        [RefreshProperties(RefreshProperties.All), Category("Searched properties"), Description("Field to return the result")]
        private string FieldName
        {
            get
            {
                return this.is_FieldName;
            }
            set
            {
                this.is_FieldName = value;
            }
        }

        [Description("Fields order"), RefreshProperties(RefreshProperties.All), Category("Searched properties")]
        private string FieldOrders
        {
            get
            {
                return this.is_FieldOrders;
            }
            set
            {
                this.is_FieldOrders = value;
            }
        }

        [Category("Searched properties"), Description("Fields to search"), RefreshProperties(RefreshProperties.All)]
        private string FilterFieldList
        {
            get
            {
                return this.is_FilterFieldList;
            }
            set
            {
                this.is_FilterFieldList = value;
            }
        }

        [RefreshProperties(RefreshProperties.All), Category("Searched properties"), Description("Left or include search")]
        private bool FilterType
        {
            get
            {
                return this.ib_FilterType;
            }
            set
            {
                this.ib_FilterType = value;
            }
        }

        [Description("First filter"), DefaultValue(""), Category("Searched properties"), RefreshProperties(RefreshProperties.All)]
        public string FirstFilter
        {
            get
            {
                return this.is_FirstFilter;
            }
            set
            {
                this.is_FirstFilter = value;
            }
        }

        [RefreshProperties(RefreshProperties.All), Category("Searched properties"), Description("Indicates if the value found in the list is valid."), DefaultValue(false)]
        public bool FoundIsValid
        {
            get
            {
                return this.ib_FoundIsValid;
            }
            set
            {
                this.ib_FoundIsValid = value;
            }
        }

        private GridControl GridBrowser
        {
            get
            {
                if (this.oBrowser == null)
                {
                    this.oBrowser = new GridControl();
                }
                return this.oBrowser;
            }
            set
            {
                if ((value != null) && (value != this.oBrowser))
                {
                    this.oBrowser = value;
                }
            }
        }

        public object InventoryCode
        {
            get
            {
                return this.is_InventoryCode;
            }
            set
            {
                this.is_InventoryCode = value;
            }
        }

        public object InventoryInputCode
        {
            get
            {
                return this.is_InventoryInputCode;
            }
            set
            {
                this.is_InventoryInputCode = value;
            }
        }

        public DateTime InvoiceDate
        {
            get
            {
                return this.id_InvoiceDate;
            }
            set
            {
                this.id_InvoiceDate = value;
            }
        }

        public object InvoicePosted
        {
            get
            {
                return this.ii_InvoicePosted;
            }
            set
            {
                this.ii_InvoicePosted = value;
            }
        }

        public DataTable LocalDetailTable
        {
            get
            {
                return this.oLocalDetailTable;
            }
            set
            {
                this.oLocalDetailTable = value;
            }
        }

        public object LocalItemCode
        {
            get
            {
                return this.is_LocalItemCode;
            }
            set
            {
                this.is_LocalItemCode = value;
            }
        }

        public int LocalWorkArea
        {
            get
            {
                return this.ii_LocalWorkArea;
            }
            set
            {
                this.ii_LocalWorkArea = value;
            }
        }

        public string MasterKey
        {
            get
            {
                return this.is_MasterKey;
            }
            set
            {
                this.is_MasterKey = value;
            }
        }

        [Description("Match case"), Category("Searched properties"), RefreshProperties(RefreshProperties.All)]
        private bool MatchCase
        {
            get
            {
                return this.ib_MatchCase;
            }
            set
            {
                this.ib_MatchCase = value;
            }
        }

        [Category("Searched properties"), RefreshProperties(RefreshProperties.All), Description("Max rows displayed on grid")]
        private int MaxRows
        {
            get
            {
                return this.ii_MaxRows;
            }
            set
            {
                this.ii_MaxRows = value;
            }
        }

        private DataRow OneRowData
        {
            get
            {
                if (this.Text.Equals(string.Empty))
                {
                    this.oDataRow = null;
                }
                else if (((this.oDataRow == null) || this.ib_TextChanged) && ((this.oDataTable != null) && (this.oDataTable.Rows.Count > 0)))
                {
                    this.ib_TextChanged = false;
                    this.oDataRow = ((DataRowView) this.oBrowser.CurrentRow.DataBoundItem).Row;
                }
                return this.oDataRow;
            }
            set
            {
                this.oDataRow = value;
            }
        }

        public object RackNumber
        {
            get
            {
                return this.is_RackNumber;
            }
            set
            {
                this.is_RackNumber = value;
            }
        }

        [Description("The field names to get data."), Category("Searched properties"), DefaultValue(""), Browsable(false), RefreshProperties(RefreshProperties.All)]
        public string SourceFields
        {
            get
            {
                return this.is_SourceFields;
            }
            set
            {
                this.is_SourceFields = value;
            }
        }

        [Category("Searched properties"), Description("Start position to search"), RefreshProperties(RefreshProperties.All)]
        private int StartPos
        {
            get
            {
                return this.ii_StartPos;
            }
            set
            {
                this.ii_StartPos = value;
            }
        }

        [RefreshProperties(RefreshProperties.All), Category("Searched properties"), Description("Table name to search")]
        public string TableName
        {
            get
            {
                return this.is_TableName;
            }
            set
            {
                if (!this.is_TableName.Equals(value))
                {
                    this.is_TableName = value;
                    if (AppDataAccess.CheckConnected)
                    {
                        this.Parameters_Get();
                    }
                }
            }
        }

        [DefaultValue((string) null), RefreshProperties(RefreshProperties.All), Category("Searched properties"), Description("The object to show description")]
        public TextBox TextDisplay
        {
            get
            {
                return this.oTextDisplay;
            }
            set
            {
                this.oTextDisplay = value;
            }
        }

        private Timer TimerKeyWait
        {
            get
            {
                if (this.oTimer == null)
                {
                    this.oTimer = new Timer();
                    this.oTimer.Interval = 250;
                    this.oTimer.Stop();
                    this.oTimer.Tick += new EventHandler(this.KeyWait);
                }
                return this.oTimer;
            }
            set
            {
                if ((value != null) && (value != this.oTimer))
                {
                    this.oTimer = value;
                }
            }
        }
    }
}

